package cn.ticket.model;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;


public class Busorder {
    private Integer id;

    private Byte orientation;

    private Date departuredate;
    
    private Date endbusdate;

    private Byte busescount=5;

    private Short seatscount=47*5;

    private Short occupation=0;
    
    private Date validitydate;

    private Date adddate=new Date();

    private String other;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Byte getOrientation() {
        return orientation;
    }

    public void setOrientation(Byte orientation) {
        this.orientation = orientation;
    }

    public Date getDeparturedate() {
        return departuredate;
    }

    public void setDeparturedate(String departuredate) throws ParseException {
        this.departuredate = new SimpleDateFormat(Constants.DATEFORMAT).parse(departuredate);
    }

    public Date getEndbusdate() {
        return endbusdate;
    }

    public void setEndbusdate(String endbusdate) throws ParseException {
        this.endbusdate = new SimpleDateFormat(Constants.DATEFORMAT).parse(endbusdate);
    }

    
    public Byte getBusescount() {
        return busescount;
    }

    public void setBusescount(Byte busescount) {
        this.busescount = busescount;
    }

    public Short getSeatscount() {
        return seatscount;
    }

    public void setSeatscount(Short seatscount) {
        this.seatscount = seatscount;
    }

    public Short getOccupation() {
        return occupation;
    }

    public void setOccupation(Short occupation) {
        this.occupation = occupation;
    }
    
    public Date getValiditydate() {
        return validitydate;
    }

    public void setValiditydate(String validitydate) throws ParseException {
        this.validitydate = new SimpleDateFormat(Constants.DATEFORMAT).parse(validitydate);
    }

    public Date getAdddate() {
        return adddate;
    }

    public void setAdddate(String adddate) throws ParseException {
        this.adddate =  new SimpleDateFormat(Constants.DATEFORMAT).parse(adddate);
    }

    public String getOther() {
        return other;
    }

    public void setOther(String other) {
        this.other = other == null ? null : other.trim();
    }
}